package gpstools.track;

import gpstools.track.addons.Source;

/**
 * Additional information regarding the track
 * 
 * @author Marcin Skruch
 * 
 */
public class TrackInfo extends AdditionalInfo {
    private static final long serialVersionUID = 1L;

    private static final String DISTANCE = "gpstools.track.Track.distance";
    private static final String ELEVATION_GAIN = "gpstools.track.Track.elevationGain";
    private static final String ELEVATION_LOSS = "gpstools.track.Track.elevationLoss";
    private static final String HEART_RATE = "gpstools.track.Track.heartRate";
    private static final String CADENCE = "gpstools.track.Track.cadence";
    private static final String SPEED = "gpstools.track.Track.speed";
    private static final String ACTIVITY_TYPE = "gpstools.track.Track.ActivityType";
    private static final String SOURCE = "gpstools.track.Track.Source";
    
	public static enum ActivityType {
		CYCLING, RUNNING, OTHER
	};

    public Double setDistance(Double distance) {
        return (Double) set(DISTANCE, distance);
    }

    public Double getDistance() {
        return (Double) get(DISTANCE);
    }

    public Double setElevationGain(Double elevationGain) {
        return (Double) set(ELEVATION_GAIN, elevationGain);
    }

    public Double getElevationGain() {
        return (Double) get(ELEVATION_GAIN);
    }

    public Double setElevationLoss(Double elevationLoss) {
        return (Double) set(ELEVATION_LOSS, elevationLoss);
    }

    public Double getElevationLoss() {
        return (Double) get(ELEVATION_LOSS);
    }

    public Short setAverageHeartRate(Short heartRate) {
        return (Short) set(HEART_RATE, heartRate);
    }

    public Short getAverageHeartRate() {
        return (Short) get(HEART_RATE);
    }

    public Short setAverageCadence(Short cadence) {
        return (Short) set(CADENCE, cadence);
    }

    public Short getAverageCadence() {
        return (Short) get(CADENCE);
    }

    /**
     * @param speed
     *            average lap speed [meters per second, m/s]
     * @return previous value
     */
    public Double setAverageSpeed(Double speed) {
        return (Double) set(SPEED, speed);
    }

    /**
     * @return average lap speed [meters per second, m/s]
     */
    public Double getAverageSpeed() {
        return (Double) get(SPEED);
    }

	public ActivityType setActivityType(ActivityType type) {
		return (ActivityType) set(ACTIVITY_TYPE, type);
	}

	public ActivityType getActivityType() {
		return (ActivityType) get(ACTIVITY_TYPE);
	}

	/**
	 * @param source
	 *            track source
	 * @return previous value
	 */
	public Source setSource(Source source) {
		return (Source) set(SOURCE, source);
	}

	public Source getSource() {
		return (Source) get(SOURCE);
	}

}
